import request from '@/utils/request'
export const getData = () => {
  return request({
    url: '/api/selectContract',
    method: 'get',
  })
}
export const getContract = () => {
  return request({
    url: '/api/contractList',
    method: 'get',
  })
}
export const getApartHouse = () => {
  return request({
    url: '/api/selectApartHouse',
    method: 'get',
  })
}
export const selectContract = (value, user_id) => {
  return request({
    url: '/api/selectContract',
    method: 'get',
    params: {
      status: value,
      user_id: user_id,
    },
  })
}
export const deleteContract = contract_id => {
  return request({
    url: '/api/deleteContract',
    method: 'put',
    params: {
      contract_id: contract_id,
    },
  })
}
export const getChargeList = () => {
  return request({
    url: 'http://localhost:3000/database/payment_manage.json',
    method: 'get',
  })
}
export const getBill = () => {
  return request({
    url: 'http://localhost:3000/database/property_item.json',
    method: 'get',
  })
}
export const newContract = (apartHouses, phone, money) => {
  return request({
    url: '/flowable/approval/process',
    method: 'post',
    data: apartHouses,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params: {
      phone: phone,
      money: money,
    },
  })
}
export const contractApproval = () => {
  return request({
    url: '/flowable/approval/tasks',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params: {
      assignee: 'manager',
    },
  })
}
export const complete = taskDTO => {
  return request({
    url: '/flowable/approval/complete',
    method: 'post',
    data: taskDTO,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
